package com.ecloud.scheduler.job;

import org.quartz.Job;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;

/**
 * @author Squbi
 */
public interface SimpleJob extends Job {
    /**
     * 默认转Detail方法
     *
     * @return {@link JobDetail}
     * @author Squbi
     * @date 2021/7/19 11:43
     */
    default JobDetail toDetail() {
        Class<? extends Job> clazz = this.getClass();
        return JobBuilder.newJob(clazz).withIdentity(clazz.getSimpleName(), "jobGroup").build();
    }
}
